using UnityEngine;
using System.Collections;

public class RotateCharacter : MonoBehaviour
{
	
	public float rotateSpeed = 1.0f;
	public Transform character;
	Transform mTrans;
	bool isPressing;
	
	void Start ()
	{
		
		if (!character) {
			Debug.Log ("Reference a character!");
			return;
		}
		
		mTrans = character;
	}
	
	void OnClick ()
	{
		isPressing = false;
	}
	
	void OnPress ()
	{
		isPressing = true;
	}
	
	void Update ()
	{
		if(!isPressing) return;
		
		mTrans.RotateAroundLocal(Vector3.up,Time.deltaTime * rotateSpeed);
	}
}
